<template>
	<view class="sub_btn_box" :style="{ '--color': vuex_config.themeColor1 }">
		<!--    底部按钮-->
		<!--  v-if="orderInfo.pay_status != '2'" -->
		<view class="sub-btn-list">
			<!-- <view v-if="checkBtn(orderInfo, -1)"><button class="sub-btn" @click="$onCancel(orderInfo.pk_id)">取消订单</button></view> -->
			<view class="btn_cont" v-if="checkBtn(orderInfo, 0)"><button class="u-reset-button sub-btn"
					@click="$onPayOrder(orderInfo,2)">立即支付</button></view>
			<view class="btn_cont" v-if="checkBtn(orderInfo, 1)"><button class="u-reset-button sub-btn"
					@click="$onValidate(orderInfo)">核销二维码</button></view>
			<view class="btn_cont" v-if="productRefund(orderInfo) &&  overtime(orderInfo.date_creation)">
				<button class="u-reset-button sub-btn"
					@click="$openRefund(orderInfo)">{{orderInfo.pay_status == 1?'申请退款':'退款退货'}}</button>
			</view>
			<view class="btn_cont" v-if="checkBtn(orderInfo, 3)"><button class="u-reset-button sub-btn"
					@click="$linkToLogistic(orderInfo)">查看物流</button></view>
			<!-- <view v-if="checkBtn(orderInfo, 4)"><button class="sub-btn" @click="$linkToComment(orderInfo)">评价</button></view> -->
			<view class="btn_cont" v-if="checkBtn(orderInfo, 5)"><button class="u-reset-button sub-btn"
					@click="$confirmGood(orderInfo)">确定收货</button></view>
			<view class="btn_cont" v-if="checkBtn(orderInfo, 6)"><button class="u-reset-button sub-btn"
					@click="$invite(orderInfo,true)">邀请好友</button></view>
			<!-- <view v-if="checkBtn(orderInfo,7)"><button class="u-reset-button sub-btn" open-type="contact" @click="$callContact">拨打客服</button></view> -->
		</view>
		<sww-pay-class ref="payCheck" @callBack="onPayPrice" :isBalance="isBalance">
		</sww-pay-class>
	</view>
</template>

<script>
	import {
		orderjs
	} from '@/components/sww-page-order/orderjs.js';
	import {
		payOrder
	} from '@/mixins/payOrder.js'
	import {
		wxConfig
	} from '@/mixins/wxConfig';
	export default {
		mixins: [orderjs, payOrder, wxConfig],
		data() {
			return {};
		},
		props: {
			orderInfo: {
				type: Object,
				default: () => {
					return {};
				}
			}
		},
		mounted() {
			// #ifdef H5
			this.initWxConfig(['chooseWXPay']).then(() => {}).catch(() => {});
			// #endif
		},
		methods: {
			$initPage() {
				this.$parent.initPage();
			}
		}
	};
</script>

<style scoped lang="scss">
	/* 底部按钮 */
	.sub_btn_box {
		height: 100rpx;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);

		.sub-btn-list {
			position: fixed;
			background-color: #fff;
			left: 0;
			bottom: 0;
			width: 100%;
			padding-right: 24rpx;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			padding-bottom: constant(safe-area-inset-bottom);
			padding-bottom: env(safe-area-inset-bottom);

			.btn_cont {
				padding: 18rpx 0;
				.sub-btn {
					margin-left: 30rpx;
					width: 200rpx;
					height: 64rpx;
					border: 2rpx solid rgba(204, 204, 204, 1);
					border-radius: 4rpx;
					color: #999999;
					font-size: 28rpx;
					display: flex;
					align-items: center;
					justify-content: center;
				}

				&:last-of-type .sub-btn {
					border-color: var(--color);
					color: #ffffff;
					background-color: var(--color);
				}
			}
		}
	}
</style>
